

function w(){
//li
    var li = document.querySelectorAll("#ul5 li");
//总价
    var span9 = document.querySelector("#span9");
    var sum = 0;

    for( var i = 0 ; i < li.length ; i++){
        var s = li[i].children[0].children[0].children[2].children[0].innerHTML;
        var r4 = li[i].children[0].children[0].children[3].children[0].value;


        var tt =  li[i].children[0].children[0].children[4].children[0].children[0].innerHTML = s * r4;


        sum += tt;
    }


//赋值给总价

    span9.innerHTML = sum.toFixed(2);

}
w();


var nn = document.querySelectorAll(".wn2 .input1");
for (var j = 0 ; j <nn.length ; j++){
    nn[j].addEventListener('change', w);
}


var sc = document.querySelectorAll(".wn .sc");
for (var l = 0 ; l < sc.length ; l++){

    sc[l].addEventListener('click',function(){
        this.parentNode.parentNode.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode.parentNode.parentNode);
        w();
    });



}